package cn.shenshen.shop.mapper;


import cn.shenshen.shop.domain.SeckillGood;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface SeckillMapper {

    @Select("select * from t_seckill_goods")
    public List<SeckillGood> query();

    @Select("select * from t_seckill_goods where good_id=#{goodId}")
    SeckillGood find(Long goodId);

    @Update("update t_seckill_goods set stock_count=stock_count-1 where good_id=#{goodId}")
    int descStock(Long goodId);
}
